GXGetShapeLocalBounds are not completely reliable for pictures, because you cannot tell what the transform for all of the objects within a picture is. Each object in the picture may have a transform set, and/or you may have nested objects (in the case of a picture within a picture). The GXGetShapeLocalBounds function returns the bounding rectangle of the source shape after the shape's transform mapping and style are applied. The dimensions of the rectangle are in the shape's local coordinates.
Try using the GXGetShapeBounds function to determine the bounding rectangle of a shape or of a specified contour of a shape. To get this in the same form that GXGetShapeLocalBounds returns, get the transform mapping and apply it to the shape.
To do this, make the following sequence of calls:
* Use the GXGetShapeTransform function to determine the transform object associated with a shape object.
* Examine the mapping property of a transform object directly using the function GXGetTransformMapping.
Once you have the transform-mapping matrix, you can tranform the bounds
returned by GXGetShapeBounds. This may seem like a roundabout way of doing
this, but it is the best way to avoid the problems you're having. Bear in mind
that you may need to iterate through the picture to get the bounds of all of
its component objects.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help